package com.qqtech.qquan.activity.service;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.qqtech.core.common.exception.BizzException;
import com.qqtech.core.frame.service.BaseService;
import com.qqtech.qquan.activity.model.ActivityBase;
import com.qqtech.qquan.activity.model.ActivityBaseQuery;
import com.qqtech.qquan.activity.model.ActivityBaseVo;

public interface ActivityBaseService extends BaseService<ActivityBase> {
	
	
	/**
	 * 关联circle查询
	 * 
	 * @param id
	 * @return
	 */
	List<ActivityBaseVo> queryListByCircle(ActivityBaseQuery query, Pageable pageable);
	/**
	 * 关联circle查询
	 * 
	 * @param id
	 * @return
	 */
	Page<ActivityBaseVo> queryPageByCircle(ActivityBaseQuery query, Pageable pageable);
	/**
	 * 先pv+1,再获取详情
	 * 
	 * @param id
	 * @return
	 */
	ActivityBaseVo handleDetail(Integer id);
	/**
	 * 显示
	 * @param id
	 * @return
	 */
	int show(int id);
	/**
	 * 隐藏
	 * @param id
	 * @return
	 */
	int hide(int id);
	
	boolean isActivityCreator(Integer userId, Integer activityId);
	
	/**
	 * 调度自动更新活动状态
	 */
	void autoStatus();
	
	/**
     * 推荐
     * @param id
     * @param isRecommend
     * @return
     * @throws BizzException
     */
    int setRecommend(Integer id, Integer recommendOidx);
    
    /**
     * 取消推荐
     * @param id
     * @return
     * @throws BizzException
     */
    int setUnRecommend(Integer id);
    
    List<ActivityBaseVo> queryActivityByUserId(Integer userId);
}